package com.example.noteshare;



import com.example.noteshare.Utilities.Repo;

import android.os.Bundle;
import android.view.View.OnClickListener;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;

public class MenuPage extends Activity implements OnClickListener{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_menu_page);
		
		Button btnMyFiles = (Button)this.findViewById(R.id.button_my_files);
		btnMyFiles.setOnClickListener(this);
		
		Button btnUpload = (Button)this.findViewById(R.id.button_upload);
		btnUpload.setOnClickListener(this);
		
		Button btnSearch = (Button)this.findViewById(R.id.button_search);
		btnSearch.setOnClickListener(this);
		
		Button logout = (Button)this.findViewById(R.id.Logout);
		logout.setOnClickListener(this);
	}

	public void onClick(View v){
		switch(v.getId()){
			case R.id.button_my_files:
				Intent i = new Intent(MenuPage.this, MyFilesPage.class);
				startActivity(i);
			break;
			case R.id.button_upload:
				Intent j = new Intent(MenuPage.this, UploadPage.class);
				startActivity(j);
			break;
			case R.id.button_search:
				Intent k = new Intent(MenuPage.this, SearchPage.class);
				startActivity(k);
			break;
			case R.id.Logout:
				Repo.userId = "";
				Intent l =new Intent(MenuPage.this, LogInPage.class);
				startActivity(l);
			break;
		}
		
	}
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.menu_page, menu);
		return true;
	}

}
